package com.evil.enterprise.controller;

import com.evil.application.api.RemoteApplicationProcessService;
import com.evil.common.application.dto.ApplicationKeyVersionReqDTO;
import com.evil.common.application.dto.process.ApplicationProcessInfoRespDTO;
import com.evil.common.core.entity.R;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 应用流程接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/application/process")
public class ApplicationProcessController {

    private final RemoteApplicationProcessService remoteApplicationProcessService;

    /**
     * 应用流程信息
     *
     * @param applicationKeyVersionReqDTO applicationKeyVersionReqDTO
     * @return R
     */
    @PostMapping("/info")
    public R<ApplicationProcessInfoRespDTO> applicationProcessInfo(@Validated @RequestBody ApplicationKeyVersionReqDTO applicationKeyVersionReqDTO) {
        return R.success(remoteApplicationProcessService.applicationProcessInfo(applicationKeyVersionReqDTO));
    }
}
